﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Brjostagjof_H4.Models.UserHandling>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Réttindi
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h3>Réttindi</h3>
    <table id="main-table">
        <tr>

            <td id="main-table-left">
<% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>

        <% string strAdmin = "Administrators";
           string strPro = "Professionals"; %>

        <div class="user-edit-info">
            <div>Notandanafn: <%: Model.UserName %></div>
            <div>Stofnaður: <%: Model.CreateDate %></div>
            <div>Virkur: <% if (Model.isActive == false)
                            { %>Óvirkur<% }
                            else { %>Virkur<% } %>
            </div>
            <div>Hlutverk: 
                <% if (Model.RoleName == strAdmin)
                   { %>Stjórnandi <% }
                   else if (Model.RoleName == strPro)
                   { %>Fagaðili <% }
                   else
                   { %>Foreldri <% } %>
            </div>
            --------------------------------------
        </div>

        <div>
            <div class="user-edit-active-radio">
            <table><tr>
                <td>
                        <div class="user-edit-role-ddl">
                            <% if (Model.RoleName == strAdmin)
                                { %>
                                <select name="Roles">
                                        <option value="Parents">Foreldri</option>
                                        <option value="Administrators" selected="selected">Stjórnandi</option>
                                        <option value="Professionals">Fagaðili</option>
                                </select>
                            <% }
                                else if(Model.RoleName == strPro)
                                { %>
                                <select name="Roles">
                                    <option value="Parents">Foreldri</option>
                                    <option value="Administrators">Stjórnandi</option>
                                    <option value="Professionals" selected="selected">Fagaðili</option>
                                </select>
                            <% }
                               else
                               { %>
                                <select name="Roles">
                                    <option value="Parents" selected="selected">Foreldri</option>
                                    <option value="Administrators">Stjórnandi</option>
                                    <option value="Professionals">Fagaðili</option>
                                </select>                        
                            <% } %>
                        </div> <!-- user-edit-role-ddl ends -->
                </td>
                <td><% if ( Model.isActive == false )
                        { %>
                            <input type="radio" name="Active" value="true" /> Virkur
                            <input type="radio" name="Active" value="false" checked="checked" /> Óvirkur
                    <% }
                        else
                        { %>
                            <input type="radio" name="Active" value="true" checked="checked"/> Virkur
                            <input type="radio" name="Active" value="false" /> Óvirkur
                    <% } %>
                </td>
            </tr></table>

            </div>
            <br />
            <div>
                <input type="submit" value="Uppfæra" />
                <span class="cancel-link"><%: Html.ActionLink("Hætta við", "EditUser") %></span>
            </div>

        </div>
    <% } %>
            </td>

            <td id="main-table-right">
                <div class="options">
                    <% if (User.IsInRole("Administrators")){Html.RenderPartial("~/Views/Home/ProfileAdminMenu.ascx", "Model");} %>
                    <% else if (User.IsInRole("Professionals")) { Html.RenderPartial("~/Views/Home/ProfileProMenu.ascx", "Model"); } %>
                    <% else { Html.RenderPartial("~/Views/Home/ProfileMenu.ascx", "Model"); } %>
                </div>
            </td>

        </tr>
    </table>

   

</asp:Content>

